'Usage
public: operator NodeId^ ( array<byte>^ value )
Parameters
- value
- The System.Byte[] array to compare this node to
'Usage
public: operator NodeId^ ( array<byte>^ value )
This produces the following output (taken from C# example):
Comparing NodeId to Byte[] Comparing ABCDE to ABCDE = [equals] True Comparing ABCDE to ABCDE = [ == ] True Comparing ABCDE to abcde = [equals] False Comparing ABCDE to abcde = [ == ] False
//define our 2 Byte[] ids, and then define our node to use the first id. byte[] id1 = new byte[] { 65, 66, 67, 68, 69 }; byte[] id2 = new byte[] { 97, 98, 99, 100, 101 }; NodeId node1 = new NodeId(id1); //convert our bytes to string so we can display them string id1String = System.Text.ASCIIEncoding.ASCII.GetString(id1); string id2String = System.Text.ASCIIEncoding.ASCII.GetString(id2); //now to compare the node to the guids Utils.LogInfo("\n\nComparing NodeId to Byte[]"); Utils.LogInfo("\tComparing {0} to {0} = [equals] {2}", id1String, id1String, node1.Equals(id1)); Utils.LogInfo("\tComparing {0} to {0} = [ = ] {2}", id1String, id1String, node1 == id1); Utils.LogInfo("\tComparing {0} to {1} = [equals] {2}", id1String, id2String, node1.Equals(id2)); Utils.LogInfo("\tComparing {0} to {1} = [ = ] {2}", id1String, id2String, node1 == id2);
'define our 2 Byte[] ids, and then define our node to use the first id. Dim id1 As Byte() = New Byte() { 65, 66, 67, 68, 69 } Dim id2 As Byte() = New Byte() { 97, 98, 99, 100, 101 } Dim node1 As NodeId = New NodeId(id1) 'convert our bytes to string so we can display them Dim id1String As String = System.Text.ASCIIEncoding.ASCII.GetString(id1) Dim id2String As String = System.Text.ASCIIEncoding.ASCII.GetString(id2) 'now to compare the node to the guids Utils.LogInfo("Comparing NodeId to Byte()") Utils.LogInfo("Comparing {0} to {0} = [equals] {2}", id1String, id1String, node1.Equals(id1)) Utils.LogInfo("Comparing {0} to {0} = [ = ] {2}", id1String, id1String, node1 = id1) Utils.LogInfo("Comparing {0} to {1} = [equals] {2}", id1String, id2String, node1.Equals(id2)) Utils.LogInfo("Comparing {0} to {1} = [ = ] {2}", id1String, id2String, node1 = id2)
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2